package com.ayoka.ui.course.detail;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.ayoka.R;
import com.ayoka.base.BaseActivity;
import com.ayoka.base.BasePresenter;
import com.ayoka.databinding.ActivityCourseCompletedBinding;
import com.ayoka.ui.training.TrainingGroupActivity;
import com.jcp.baselibrary.model.ToolBarOptions;


/**
 * @author jcp
 * @ClassName: TopicListActivity
 * @Description:
 * @date 2018-12-28 下午4:21:18
 */
public class CourseCompletedActivity extends BaseActivity<ActivityCourseCompletedBinding, BasePresenter> {

    public static void start(Activity activity, long courseId) {
        Intent intent = new Intent(activity, CourseCompletedActivity.class);
        intent.putExtra("CourseId", courseId);
        activity.startActivity(intent);
    }

    private long courseId;

    @Override
    protected void configIntentValue() {
        courseId = getIntent().getLongExtra("CourseId", 0);
    }

    @Override
    public int getContentLayout() {
        return R.layout.activity_course_completed;
    }

    @Override
    protected void initViews() {
        mDataBinding.btnGoToTraining.setOnClickListener(this);
    }

    @Override
    protected void initData(Bundle savedInstanceState) {
        ToolBarOptions options = new ToolBarOptions();
        options.navigateId = R.mipmap.icon_close_black_cross;
        setCustomToolBar(mDataBinding.customToolbar.toolbar, options);
    }

    @Override
    protected BasePresenter getPresenter() {
        return null;
    }

    @Override
    public void onClick(View view) {
        super.onClick(view);
        if (view == mDataBinding.btnGoToTraining){
            TrainingGroupActivity.start(this, courseId, 0);
            finish();
        }
    }
}
